package cn.starlightsoftware.sherly.framework.oss.config;

import io.minio.MinioClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 谷子毅
 */
@Configuration
@EnableConfigurationProperties(OssProperties.class)
public class OssConfig {
    
    @Bean
    public MinioClient createFileConfig(OssProperties ossProperties) {
        return MinioClient.builder()
                .endpoint(ossProperties.getEndpoint())
                .credentials(ossProperties.getAccessKey(), ossProperties.getAccessKeySecret())
                .build();
    }

}
